home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / CC_C / 1116.ZIP / TOOLKIT.ARC / GETNUM.C < prev    next >
Text File  |  1979-12-31  |  1KB  |  36 lines

  1.  
  2. /* GETNUM.C
  3.                Note:  A>link
  4.                              [.OBJ]: getnum.obj + getint.obj + stdio.obj
  5.                              [.EXE]: getnum.exe
  6.                              [.MAP]: <cr>
  7.                              [.LIB]: cpclib.lib
  8. */
  9.  
  10. main()
  11.        {
  12.          int n;
  13.          int10(6,0,7,0,0,0,24,79);  /* clearscreen via BIOS */
  14.          int10(2,0,0,0,0,0,0,0);    /* home the cursor */
  15.          putchar(13);
  16.          puts("Enter a decimal number: "); n = getint("%d",n);
  17.          puts("The number is: "); printf("%d",n);
  18.          putchar(13);
  19.          puts("Enter a hexadecimal number: "); n = getint("%h",n);
  20.          puts("The number is: "); printf("%d",n);
  21.          putchar(13);
  22.          puts("Enter an octal number: "); n = getint("%o",n);
  23.          puts("The number is: "); printf("%d",n);
  24.          putchar(13);
  25.          puts("Enter a binary number: "); n = getint("%b",n);
  26.          puts("The number is: "); printf("%d",n);
  27.          int10(2,0,0,0,0,0,10,70); /* cursor at row 10, column 70 */
  28.          putchar(65);
  29.          n = getval(10,70,n);
  30.          int10(2,0,0,0,0,0,22,0);
  31.          puts("The ASCII value at 10,70 is: "); printf("%d",n);
  32.        }
  33.  
  34.  
  35.  
  36.